package users

import (
	"context"
	"shenmawl/api/user/v1"
)

func (c *NoRBACControllerV1) UserVCode(ctx context.Context, req *v1.VCodeReq) (res *v1.VCodeRes, err error) {
	id, b64s, _, err := c.usersNoRBAC.CreateAndSaveCaptcha(ctx)
	if err != nil {
		return nil, err
	}
	return &v1.VCodeRes{
		Id:  id,
		Img: b64s,
	}, nil
}
